<?php


namespace App\Http\Controllers\Api;
use App\Http\Controllers\BaseController;
use App\Models\Banner;
use Dingo\Api\Http\Request;

class BannerController extends BaseController
{
    /**
     * 列表
     * @param Request $request
     * @return mixed
     */
    public function index(Request $request) {
        $type = $request->input('type', 2);
        $list = Banner::orderBy('sort', 'desc')->type($type)->orderBy("id", "desc")
            ->paginate(per_page());
        return $this->paginate($list);
    }

}

